package com.server.runtime;

import gnu.cajo.invoke.Remote;

import java.io.Serializable;
import java.rmi.RemoteException;

import combat.protocol.interfaces.UserInt;
import combat.protocol.interfaces.VehicleInt;

public class userImpl implements UserInt, Serializable {

	private static final long serialVersionUID = 1L;

	private int userID = -1;
	private String userName = ""+userID+"";
	private VehicleInt userVehicle = null;

	public userImpl(int userID, String userName) {
		this.userID = userID;
		this.userName = userName;
	}

	@Override
	public int getUserID() {
		return userID;
	}
	@Override
	public void setUserID(int userID) {
		this.userID = userID;
	}
	@Override
	public String getUserName() {
		return userName;
	}
	@Override
	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Override
	public VehicleInt getUserVehicle() {
		return userVehicle;
	}
	@Override
	public void setUserVehicle(VehicleInt userVehicle) {
		this.userVehicle = userVehicle;
	}

	@Override
	public Remote getUserVehicle_Remote() {
		try {
			return new Remote(getUserVehicle());
		} catch (RemoteException e) {
			System.out.println("ERROR: Update getUserVehicle function failed");
		}
		return null;
	}


}